﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BlobCacheManager.aspx.cs" Inherits="BlobCacheManager.Layouts.BlobCacheManager.BlobCacheManager" DynamicMasterPageFile="~masterurl/default.master" %>

<%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="/_controltemplates/ButtonSection.ascx" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<div style="text-align: right; padding: .2em;"><a href="http://bramnuyts.wordpress.com" target="_blank">http://bramnuyts.wordpress.com</a></div>
<table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
   <colgroup>
      <col style="width: 40%"></col>
      <col style="width: 60%"></col>
   </colgroup>
   <tr>
    <td>
        <wssuc:InputFormSection ID="BlobCacheInputFormSection" runat="server"
                 Title="Web Application Blob Cache Settings"
                 Collapsible="false" >
              <template_description>
                 <asp:Label ID="BlobCacheDescription" runat="server" Text="In this section you can configure the blob cache for the selected web application. These changes will be edited in the web.config by SharePoint."></asp:Label>
              </template_description>
              <template_inputformcontrols>
                 <wssuc:InputFormControl runat="server" LabelText="Enabled" ExampleText="Wether blobcache is enabled or not."
                        LabelAssociatedControlId="EnabledCheckBox">
                    <Template_Control>
                        <asp:CheckBox ID="EnabledCheckBox" runat="server"></asp:CheckBox>
                    </Template_Control>
                 </wssuc:InputFormControl>
                 <wssuc:InputFormControl runat="server" LabelText="Max Size" ExampleText="The maximum size in GB the blobcache may use."
                        LabelAssociatedControlId="MaxSizeTextBox">
                    <Template_Control>                   
                        <SharePoint:InputFormTextBox runat="server" ID="MaxSizeTextBox" Width="60%" />
                        <asp:RegularExpressionValidator 
                        ControlToValidate="MaxSizeTextBox" 
                        ValidationExpression="^\d+$"
                        ID="RegularExpressionValidator_MaxSizeTextBox" 
                        runat="server"
                        Display="Dynamic"
                        ErrorMessage="Provide a valid number."></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator_MaxSizeTextBox" 
                        runat="server" 
                        ControlToValidate="MaxSizeTextBox"
                        Display="Dynamic"
                        ErrorMessage="Please fill in a size."></asp:RequiredFieldValidator>
                    </Template_Control>
                 </wssuc:InputFormControl>
                 <wssuc:InputFormControl runat="server" LabelText="Location" ExampleText="Specify the location where the blobcache is stored."
                        LabelAssociatedControlId="LocationTextBox">
                    <Template_Control>                   
                        <SharePoint:InputFormTextBox runat="server" ID="LocationTextBox" Width="60%" />
                        <asp:RegularExpressionValidator 
                        ControlToValidate="LocationTextBox" 
                        ValidationExpression="^(([a-zA-Z]:)\$?)(\\(\w[\w ]*))+((\\)|())$"
                        ID="RegularExpressionValidator_LocationTextBox" 
                        runat="server" 
                        Display="Dynamic"
                        ErrorMessage="Provide a valid path."></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator_LocationTextBox" 
                        runat="server" 
                        ControlToValidate="LocationTextBox"
                        Display="Dynamic"
                        ErrorMessage="Please fill in a location."></asp:RequiredFieldValidator>
                    </Template_Control>
                 </wssuc:InputFormControl>
                 <wssuc:InputFormControl runat="server" LabelText="Max Age" ExampleText="Specify the maximum time (in seconds) that the blobcache is stored."
                        LabelAssociatedControlId="MaxAgeTextBox">
                    <Template_Control>                   
                        <SharePoint:InputFormTextBox runat="server" ID="MaxAgeTextBox" Width="60%" />
                        <asp:RegularExpressionValidator 
                        ControlToValidate="MaxAgeTextBox" 
                        ValidationExpression="^\d+$"
                        ID="RegularExpressionValidator_MaxAgeTextBox" 
                        runat="server" 
                        Display="Dynamic"
                        ErrorMessage="Provide a valid number."></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator_MaxAgeTextBox" 
                        runat="server" 
                        ControlToValidate="MaxAgeTextBox"
                        Display="Dynamic"
                        ErrorMessage="Please fill in a maximum age (default is 86400)."></asp:RequiredFieldValidator>
                    </Template_Control>
                 </wssuc:InputFormControl>
                 <wssuc:InputFormControl runat="server" LabelText="Path" ExampleText="Specify the file extensions of the files that should be stored in the blobcache"
                        LabelAssociatedControlId="PathTextBox">
                    <Template_Control>                  
                        <SharePoint:InputFormTextBox Rows="3" runat="server" ID="PathTextBox" Width="80%" />
                        <asp:RegularExpressionValidator 
                        ControlToValidate="PathTextBox" 
                        ValidationExpression="^\w+(\|\w+)*$"
                        ID="RegularExpressionValidator_PathTextBox" 
                        runat="server" 
                        Display="Dynamic"
                        ErrorMessage="Enter file extensions without . separated by |"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator_PathTextBox" 
                        runat="server" 
                        ControlToValidate="PathTextBox"
                        Display="Dynamic"
                        ErrorMessage="Please fill in a the file extensions seperated with | (default is gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)."></asp:RequiredFieldValidator>
                    </Template_Control>
                 </wssuc:InputFormControl>
              </template_inputformcontrols>
          </wssuc:InputFormSection>
      </td>
    </tr>
</table>
      <wssuc:ButtonSection runat="server">
        <template_buttons>
			<asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" Text="OK" id="BtnSubmitBottom" Enabled="true" OnClick="Btn_Ok_Click" />
		</template_buttons>
    </wssuc:ButtonSection>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
BlobCache Manager
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
Manage the Web Application's Blob Cache
</asp:Content>
